<template>
  <div>
    <Chart :cdata="cdata" />
  </div>
</template>

<script>
import Chart from './chart.vue';
import { queryFeedbackDeal } from "../../../../api/index.js";
export default {
  data() {
    return {
      cdata: {
        xData: ["资金", "资产", "资源", "党务", "村务", "其他"],
        seriesData: [
          { value: 10, name: "资金" },
          { value: 25, name: "资产" },
          { value: 55, name: "资源" },
          { value: 15, name: "党务" },
          { value: 25, name: "村务" },
          { value: 15, name: "其他" },
        ]
      }
    }
  },
  components: {
    Chart,
  },
  mounted() {
    this.getData()
  },
  methods: {
    getData() {
      let that = this;
      queryFeedbackDeal().then(res => {
        console.log(res)
        that.cdata.seriesData[0].value = res.data.fundsNum
        that.cdata.seriesData[1].value = res.data.assetsNum
        that.cdata.seriesData[2].value = res.data.resourcesNum
        that.cdata.seriesData[3].value = res.data.partyNum
        that.cdata.seriesData[4].value = res.data.villageNum
        that.cdata.seriesData[5].value = res.data.otherNum
      })
    }
  }
}
</script>

<style lang="scss" scoped>
</style>